import { ADD, SUB } from './constants'
export default function (state = { count: 0, xxx: '哈哈' }, action) {
  switch (action.type) {
    case ADD:
      return {
        ...state,
        count: state.count + action.payload,
      }
    case SUB:
      return {
        ...state,
        count: state.count - action.payload,
      }

    default:
      return state
  }
}
